﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Comet
{
    class Stats
    {
        public static class ChatStats
        {
            public static int OnlineChats = 0;
            public static int OnlineAnyones = 0;
            public static int OnlineMalesToFemales = 0;
            public static int OnlineFemalesToMales = 0;
            public static int OnlineMalesToMales = 0;
            public static int OnlineFemalesToFemales = 0;

            public static int AllChats = 0;
            public static int AllAnyones = 0;
            public static int AllMalesToFemales = 0;
            public static int AllFemalesToMales = 0;
            public static int AllMalesToMales = 0;
            public static int AllFemalesToFemales = 0;

            public static int MessagesSent = 0;
            public static int OutboundData = 0;

        }

        public static byte[] GetStatsString()
        {
            var stats = new string[][]{

                new string[]{"Online Chats", ChatStats.OnlineChats.ToString() },
                new string[]{"Online Anyones", ChatStats.OnlineAnyones.ToString() },
                new string[]{"Online Males To Females", ChatStats.OnlineMalesToFemales.ToString() },
                new string[]{"Online Females To Males", ChatStats.OnlineFemalesToMales.ToString() },
                new string[]{"Online Males To Males", ChatStats.OnlineMalesToMales.ToString() },
                new string[]{"Online Females To Females", ChatStats.OnlineFemalesToFemales.ToString() },

                new string[]{"", ""},

                new string[]{"All Chats", ChatStats.AllChats.ToString() },
                new string[]{"All Anyones", ChatStats.AllAnyones.ToString() },
                new string[]{"All Males To Females", ChatStats.AllMalesToFemales.ToString() },
                new string[]{"All Females To Males", ChatStats.AllFemalesToMales.ToString() },
                new string[]{"All Males To Males", ChatStats.AllMalesToMales.ToString() },
                new string[]{"All Females To Females", ChatStats.AllFemalesToFemales.ToString() },

                new string[]{"", ""},

                new string[]{"Messages Sent", ChatStats.MessagesSent.ToString() },
                new string[]{"Outbound Data (MB)", (ChatStats.OutboundData / 1024).ToString() }
            };

            string raw = Extra.oSerializer.Serialize(stats);

            return Encoding.UTF8.GetBytes(raw);

        }

    }
}
